<?php

namespace app\admin\controller;

use app\common\controller\Backend;

/**
 * 用户留言管理
 *
 * @icon fa fa-circle-o
 */
class Message extends Backend
{
    
    /**
     * Message模型对象
     * @var \app\admin\model\Message
     */
    protected $model = null;

    public function _initialize()
    {
        parent::_initialize();
        $this->model = new \app\admin\model\Message;
    }

    public function detail($ids)
    {
        $row = $this->model->get(['id' => $ids]);
        if (!$row)
            $this->error(__('No Results were found'));
        $row['createtime'] = date('Y-m-d H:i:s', $row['createtime']);
        $this->view->assign("row", $row->toArray());
        return $this->view->fetch();
    }
}
